<?php
class Admin_Form_Subjects extends Zend_Form{
	
	function __construct($options=null){
		parent::__construct($options);
		
		$sub_id = new Zend_Form_Element_Hidden('subject_id');
		$sub_id -> setAttrib('class', 'form_els');
		
		$name = new Zend_Form_Element_Text('name');
		$name->setRequired(TRUE)
			->setLabel('Название предмета')
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->addValidator('NotEmpty')
			->setAttrib('class', 'form_els')
			->setDecorators(array(
					'ViewHelper',
					'Errors',
					'Label',
					array(array('data' => 'HtmlTag'), array('tag' => 'td')),
					))
					->addDecorator('Label',array(array('data' => 'HtmlTag'), array('tag' => 'td')));
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')
				->setLabel('Сохранить')
				
				->setDecorators(array(
					'ViewHelper',
					'Errors',
					array(array('data' => 'HtmlTag'), array('tag' => 'td')),
				));
		
		$this->addElements(array($sub_id, $name, $submit))
			->setAttrib('id', 'popup_form')
			->setMethod('post')
			->setView(new Zend_View)
			->clearDecorators()
			->setDecorators(array(
				'FormElements',
				array('HtmlTag', array('tag' => 'table', 'class'=>'login_form')),
				array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
			'Form',
			));
	}
}